const Router = require('koa-router');
const {
  verifyJwt,
  verifyPermission,
  validContent,
} = require('../middlewares/common.middleware');
const controller = require('../controller/moment.controller');

const router = new Router({ prefix: '/moment' });

router.post('/create', verifyJwt, validContent, controller.create);
router.get('/list', controller.list);
router.get('/:id', controller.detail);
router.patch(
  '/:id',
  verifyJwt,
  verifyPermission('moment'),
  validContent,
  controller.update
);
router.delete('/:id', verifyJwt, verifyPermission('moment'), controller.remove);

// 添加标签
router.post('/addTags', verifyJwt, verifyPermission('moment'),controller.addTags);

module.exports = router;
